Benjamin Otte [Mon, 26 Jul 2021 00:16:47 +0000 (02:16 +0200)]
dnd: Guard drags with a reference when finishing
Usually the "dnd-finished" signal will be used to unref the GdkDrag. In
those cases, we would lose the object, so that when we do the final
drag_drop_done() afterwards, we wouldn't have a remaining reference.
With the reference guard, this now works.
Benjamin Otte [Thu, 22 Jul 2021 14:23:06 +0000 (16:23 +0200)]
glx: Get rid fo DrawableInfo
Store the frame counter in the surface, where it belongs.
Chun-wei Fan [Mon, 19 Jul 2021 09:13:53 +0000 (17:13 +0800)]
gdkdisplay-win32.c: Don't call ReleaseDC() unnecessarily
The dummy Win32 window that we use to capture display change events and
to create dummy WGL contexts was created with CS_OWNDC, so we really do
not need to (and should not) call ReleaseDC() on the HDC that we
obtained from it, so drop these calls.
Chun-wei Fan [Mon, 19 Jul 2021 02:48:03 +0000 (10:48 +0800)]
GDK-Win32: init_gl(): Default to WGL for now
Since the shaders need to be updated for using with GLES (libANGLE at
least), default to WGL for now. Unfortunately it is not that common for
Windows to have GLES support, in which the easiest way to obtain such
support is via Google's libANGLE.
Chun-wei Fan [Mon, 19 Jul 2021 02:32:28 +0000 (10:32 +0800)]
GDK-Win32: Fixup, and cleanup WGL HDC handling
It turns out that the problem of the WGL window not drawing was due to
the fact that I messed up where I placed SwapBuffers() during the
conversion... doh:|
At the same time, stop storing the HDC in the GdkWin32GLContextWGL, but
instead always create it along the surface we created, so that it is ready
for use for operating with WGL when we are not dealing with "surfaceless"
contexts. If we are dealing with "surfaceless" contexts, just use the
HDC of the dummy window that we created when we created the
Gdk(Win32)Display.
WGL contexts should now be in working order at this point.
Chun-wei Fan [Wed, 14 Jul 2021 09:46:31 +0000 (17:46 +0800)]
Split out WGL/EGL stuff and simplify things
This commit attempts to split GdkWin32GLContext into two parts, one for
WGL and the other for EGL (ANGLE), and attempts to simplify things a
bit, by:
* We are already creating a Win32 window to capture display changes,
so we can just use that to act as our dummy window that we use to
find out the pixel format that the system supports for WGL. We also
use it to obtain the dummy legacy WGL context that we will always
require to create our more advanced Core WGL contexts.
* Like what is done in X11, store up the WGL pixel format or the
EGLConfig in our GdkWin32Display.
* Ensure we do not create the dummy WGL context unnecessarily.
In this way, we can successfully create the WGL/EGL contexts, however
there are some issues at this point:
* For WGL, the code successfully initializes and realizes the WGL
Contexts, but for some reason things became invisible. When running
gtk4-demo, this can be verified by seeing the mouse cursor changing
when moved to spots where one can resize the window, although they
were invisible.
* For EGL, the code initializes EGL but could not realize the EGL
context as shaders failed to compile. It seems like the shader issue
is definitely outside the scope of this MR.
Benjamin Otte [Sat, 10 Jul 2021 00:29:17 +0000 (02:29 +0200)]
gl: Fix issue with EGL + nvidia
nvidia sets the default draw buffer to GL_NONE if EGL contexts are
initially bound to EGL_NO_SURFACE which is exactly what we are doing. So
bind them to GL_BACK when drawing, as they should be.
See https://phabricator.services.mozilla.com/
D118743 for a discussion
about EGL_NO_CONTEXT and draw buffers.
Chun-wei Fan [Wed, 14 Jul 2021 04:28:07 +0000 (12:28 +0800)]
GDK: Add debug option for WGL usage
This way, one can force using WGL on Windows even if EGL support was
enabled. Also update the help text for gl-egl as it will apply for
Windows, albeit a bit later.
Chun-wei Fan [Wed, 14 Jul 2021 04:19:52 +0000 (12:19 +0800)]
GDK-Win32: Move some functions out of gdkglcontext-win32.c
We want these to be out of the way as we split between WGL and EGL/ANGLE
GL contexts, so that they don't get in the way.
Benjamin Otte [Tue, 13 Jul 2021 03:23:41 +0000 (05:23 +0200)]
display: Move GL selection code into gdkdisplay-x11.c
This has the benefit that we can refactor it and make sure we deal with
GdkDisplay::init_gl() not being called at all because
GDK_DEBUG=gl-disable had been specified.
Benjamin Otte [Tue, 13 Jul 2021 03:04:45 +0000 (05:04 +0200)]
x11: Move code from GdkGLContextX11
It's not used there, but both backends have independent
immplementationgs for it.
I want to get rid of GdkGLContextX11 and moving code from it is the
first step.
Benjamin Otte [Fri, 9 Jul 2021 01:28:34 +0000 (03:28 +0200)]
inspector: Add support for displaying GL errors
Also, no need to show a GL version if GL isn't available.
Benjamin Otte [Fri, 9 Jul 2021 00:50:32 +0000 (02:50 +0200)]
gdk: Move GL context construction to GdkGLContext
Now that we have the display's context to hook into, we can use it to
construct other GL contexts and don't need a GdkSurface vfunc anymore.
This has the added benefit that backends can have different GdkGLContext
classes on the display and get new GLContexts generated from them, so
we get multiple GL backend support per GDK backend for free.
I originally wanted to make this a vfunc on GdkGLContextClass, but
it turns out all the abckends would just call g_object_new() anyway.
Benjamin Otte [Wed, 7 Jul 2021 02:40:34 +0000 (04:40 +0200)]
gl: Move vfunc
Instead of
Display::make_gl_context_current()
we now have
GLContext::clear_current()
GLContext::make_current()
This fits better with the backends (we can actually implement
clearCurrent on macOS now) and makes it easier to implement different GL
backends for backends (like EGL/GLX on X11).
We also pass a surfaceless boolean to make_current() so the calling code
can decide if a surface needs to be bound or not, because the backends
were all doing whatever, which was very counterproductive.
Benjamin Otte [Wed, 7 Jul 2021 01:00:09 +0000 (03:00 +0200)]
gl: Require EGL_KHR_surfaceless_context with egl
The code to create and manage a fake egl surface to bind to is
complex and completely untested because everyone seems to support this
extension.
nvidia and Mesa do support it and according to Mesa devs, adding support
in a new driver is rather simple and Mesa drivers gain that feature
automatically, so all future drivers shoould have it.
Benjamin Otte [Tue, 6 Jul 2021 02:50:01 +0000 (04:50 +0200)]
gdk: Get rid of paint contexts
... or more exactly: Only use paint contexts with
gdk_cairo_draw_from_gl().
Instead of paint contexts being the only contexts who call swapBuffer(),
any context can be used for this, when it's used with
begin_frame()/end_frame().
This removes 2 features:
1. We no longer need a big sharing hierarchy. All contexts are now
shared with gdk_display_get_gl_context().
2. There is no longer a difference between attached and non-attached
contexts. All contexts work the same way.
Benjamin Otte [Tue, 6 Jul 2021 02:47:15 +0000 (04:47 +0200)]
gl: Store the context::in-frame state in the current context
Do not treat the context as already current when the value
of context::in-frame changes.
This is so we can bind to EGL_NO_SURFACE if context::in-frame == false
and to context::surface if context::in-frame == true.
This allows getting rid of the attached property in future commits.
Benjamin Otte [Sat, 10 Jul 2021 01:24:00 +0000 (03:24 +0200)]
gl: Deprecate gdk_gl_context_get_shared_context()
It's not used anymore. And in particular we do want to keep the display
context private, so we're not gonna return it from this function.
Benjamin Otte [Wed, 30 Jun 2021 02:52:35 +0000 (04:52 +0200)]
gdk: Add gdk_gl_context_is_shared()
... and use it in the GL renderers.
Benjamin Otte [Mon, 5 Jul 2021 02:24:43 +0000 (04:24 +0200)]
ngl: Store the shared driver in the display
... instead of some random GL context.
Benjamin Otte [Mon, 5 Jul 2021 01:04:08 +0000 (03:04 +0200)]
gdk: Require EGL version 1.4 across the board
Mesa currently ships 1.5.
Benjamin Otte [Sun, 4 Jul 2021 23:57:03 +0000 (01:57 +0200)]
gdk: Add GdkDisplay::init_gl vfunc
The vfunc is called to initialize GL and it returns a "base" context
that GDK then uses as the context all others are shared with. So the GL
context share tree now looks like:
+ context from init_gl
- context1
- context2
...
So this is a flat tree now, the complexity is gone.
The only caveat is that backends now need to create a GL context when
initializing GL so some refactoring was needed.
Two new functions have been added:
* gdk_display_prepare_gl()
This is public API and can be used to ensure that GL has been
initialized or if not, retrieve an error to display (or debug-print).
* gdk_display_get_gl_context()
This is a private function to retrieve the base context from
init_gl(). It replaces gdk_surface_get_shared_data_context().
Benjamin Otte [Sun, 4 Jul 2021 18:55:53 +0000 (20:55 +0200)]
wayland: Don't pass GL config to get_egl_surface()
There's only one GL config.
Benjamin Otte [Sun, 4 Jul 2021 17:48:11 +0000 (19:48 +0200)]
wayland: Move fbconfig into the display
Create it during init and then reuse it for all contexts.
While doing that, also improve error reporting - that's not used yet but
will in later commits.
Benjamin Otte [Sun, 4 Jul 2021 00:43:49 +0000 (02:43 +0200)]
gdk: Allow GdkDrawContext with a %NULL surface
This is not used yet, but it allows surfaceless GL contexts.
For that purpose, we need to make the display a construct-only property,
so that it can be set when the surface isn't.
This adds a bunch of very picky checks in the constructor so nothing bad
can happen.
Benjamin Otte [Sat, 3 Jul 2021 23:43:16 +0000 (01:43 +0200)]
gdk: Add a private struct to GdkDisplay
... and move some members from the GdkDisplay struct.
We've always wanted to add one to isolate the display from the backends
a bit more, but so far it's never happened.
Now that I'm about to add more data to GdkDisplay, it's a good excuse to
start.
Benjamin Otte [Fri, 2 Jul 2021 01:37:32 +0000 (03:37 +0200)]
x11: Redo choice between EGL and GLX
We try EGL first, but are very picky about what we accept.
If that fails, we try to go with GLX instead.
And if that also fails, we try EGL again, but this time accept anything.
The idea here is that EGL is the preferred method going forward, but GLX is
the tried and tested method that we know works. So if we detect issues with
EGL, we want to avoid using it in favor of GLX.
Also add a GDK_DEBUG=gl-egl option to force EGL at all costs and not try
GLX.
Benjamin Otte [Fri, 2 Jul 2021 01:21:14 +0000 (03:21 +0200)]
x11: Properly record the error when initializing GL
That way, we can give a useful error message when things break down for
users.
These error messages could still be improved in places (like looking at
the actual EGL error codes), but that seemed overkill.
Benjamin Otte [Fri, 2 Jul 2021 00:33:18 +0000 (02:33 +0200)]
x11: Do not call glXQueryExtension()
epoxy does that already.
Benjamin Otte [Fri, 18 Jun 2021 12:46:24 +0000 (14:46 +0200)]
x11: Get Visual from EGL directly
Query the EGL_VISUAL_ID from the egl Config and select a config with the
matching Visual.
This is currently broken on Mesa because it does not expose any RGBA
X Visuals in any EGL config, so we always end up with opaque Windows.
https://gitlab.freedesktop.org/mesa/mesa/-/issues/149
Benjamin Otte [Tue, 29 Jun 2021 21:45:50 +0000 (23:45 +0200)]
x11: Store the GLX drawable in the surface
Also, stop using a dummy window for unattached GL contexts and instead
use the display's leader surface.
Again, this mirrors EGL.
Benjamin Otte [Tue, 29 Jun 2021 20:10:48 +0000 (22:10 +0200)]
x11: Use single GLX fbconfig and store it in the display
This mirrors the code for the EGL config.
Benjamin Otte [Tue, 29 Jun 2021 16:45:04 +0000 (18:45 +0200)]
x11: Remove glx version check
We only work with GLX >= 1.3 anyway, so don't explicitly check for it
and pretend to do something else that doesn't work otherwise.
Benjamin Otte [Tue, 29 Jun 2021 16:44:09 +0000 (18:44 +0200)]
x11: Remove unused struct member
We don't care if the GL context is direct at all.
Benjamin Otte [Tue, 15 Jun 2021 12:48:55 +0000 (14:48 +0200)]
Revert "x11: Always fall back to GLX on NVIDIA"
This reverts commit
c35a6725b99722d91b0ed6580546c27c8f0849ba.
This approach doesn't work because if NVIDIA doesn't work for EGL, the
EGL implementation won't be provided by NVIDIA, so checking the vendor
doesn't work.
Benjamin Otte [Sun, 13 Jun 2021 21:35:06 +0000 (23:35 +0200)]
x11: Remove the dummy surface
Instead, use the display's "leader surface" when no surface is required,
because we have it lying around.
Really, we want to use EGL_NO_SURFACE, but if that's not supported...
Benjamin Otte [Sun, 13 Jun 2021 15:43:15 +0000 (17:43 +0200)]
x11: Remove GdkVisual
It's not used anymore.
Benjamin Otte [Sun, 13 Jun 2021 15:34:55 +0000 (17:34 +0200)]
x11: Rework Visual selection
Instead of going via GdkVisual, doing a preselection and letting the GL
initialization improve it, let the GL initialization pick an X Visual
directly using X Visual code directly.
The code should select the same visuals as before as it tries to apply
the same logic, but it's a rewrite, so I expect I messed something up.
Benjamin Otte [Sat, 12 Jun 2021 09:13:22 +0000 (11:13 +0200)]
glx: Remove Visual cache
1. We're using EGL most of the time anyway, so if we wanted to cache
things, we'd need to port it there.
2. Our GL handling is massively configurable, so determining when to use
the cache and when not is a challenge.
3. It makes startup nondeterministic and depend on whether a GTK4 app
has previously been started on this display and nobody thinks about
that when debugging.
4. The only benefit of the caching is delaying GL initialization - which
made sense in GTK3 where almost no app used GL but doesn't make sense
in GTK4 where almost every app uses GL.
So unless I find a big benefit to reintroducing it, this cache will be
gone for good.
Benjamin Otte [Sat, 12 Jun 2021 09:07:24 +0000 (11:07 +0200)]
x11: Move GL init code into the GL context
No functional changes, just shuffling code.
Benjamin Otte [Thu, 10 Jun 2021 21:10:22 +0000 (23:10 +0200)]
x11: Store the EGL surface in the GdkSurfaceX11
Avoids having to use private data, though the benefit is somewhat
limited as we still have to put the destructor in the egl code and can't
just put it in gdk_surface_x11_finalize().
Benjamin Otte [Wed, 9 Jun 2021 11:42:19 +0000 (13:42 +0200)]
x11: Store the EGL config in the display
We only have one config, because we use the same Visual everywhere.
Store this config in the GdkDisplayX11 struct for easy access.
Also do this on initialize, because if creating the config fails, we
want to switch to GLX instead of failing to do GL at all.
This also simplifies a lot of code as we can share Visual, Colormap, etc
across surfaces.
Benjamin Otte [Mon, 7 Jun 2021 12:30:29 +0000 (14:30 +0200)]
x11: Move the EGL display into the private struct
There's no need to use g_object_set_data() for it.
We can also stop caching it elsewhere because we know the display has
it.
And finally, we can remove the display->have_egl boolean and use
display->egl_display != NULL instead. We initialize the display at
startup, so that variable is the perfect indicator.
Benjamin Otte [Sun, 6 Jun 2021 17:56:35 +0000 (19:56 +0200)]
x11: Pass the display, not the screen
Screens are on their way out.
Benjamin Otte [Sun, 6 Jun 2021 15:29:29 +0000 (17:29 +0200)]
x11: Simplify code
These variables were a lot more important in GTK3, but now we just want
to pass them through to X.
Benjamin Otte [Sun, 6 Jun 2021 15:18:16 +0000 (17:18 +0200)]
x11: Move function call
The GLX visual selection is GLX specific, so it can be handled by the GLX
code.
There should be no reordering here, the call was just moved.
Benjamin Otte [Sun, 6 Jun 2021 15:14:31 +0000 (17:14 +0200)]
glx: Don't initialize GLX multiple times.
Either it is initialized or it isn't.
Benjamin Otte [Sun, 6 Jun 2021 15:07:05 +0000 (17:07 +0200)]
x11: Initialize GL at startup
We need to initialize GL to select the Visual we are going to use for
all our Windows.
As the Visual needs to be known before we know if we are even gonna use
GL later, we can't avoid initializing it.
Note that this previously happened, too. It was just hidden behind the
GdkScreen initialization.
Benjamin Otte [Thu, 3 Jun 2021 17:20:51 +0000 (19:20 +0200)]
x11: Don't share cached GLX visuals with GTK3
We don't want to bind ourselves to GTK3 - both because we don't want to
accidentally cause bugs in a different codebase and because we want to
deviate from it.
While doing so, also store visuals as visuals and not as integers.
And only store one Visual because GTK4 only uses one visual.
And then remove the code that is leftover for dealing with the
compatibility Visual for GTK3.
PS: I'm kinda proud of my STRINGIFY_WITHOUT_BRACKETS hack.
Benjamin Otte [Thu, 3 Jun 2021 03:02:15 +0000 (05:02 +0200)]
x11: Reorder code
Initialize the GL visuals from gdkdisplay.c so the call into the GL
stack isn't hidden in gdkvisual.c
This is relevant for further commits.
Benjamin Otte [Thu, 3 Jun 2021 02:54:37 +0000 (04:54 +0200)]
x11: Stop reordering visuals
The old code was ordering visuals by depth, but considering that these
days we either use the default visual or a 32bit RGBA visual, that
reordering does not have an effect anymore.
In theory, the only effect is that the GLX Visual selection might select
a different replacement Visual when it checks for improved GL Visuals, but
even there I can't come up with a case where that matters, because
again, the visuals are only reordered by depth and we want to keep the
depth.
In any case, make this a separate commit so bisecting can find this
problem if it ever shows up.
Benjamin Otte [Thu, 3 Jun 2021 02:45:36 +0000 (04:45 +0200)]
x11: Remove unused function
Now that we can't create extra GdkX11Screens anymore, this also means
that there is exactly 1 GdkX11Screen per GdkX11Display.
Benjamin Otte [Thu, 3 Jun 2021 02:42:23 +0000 (04:42 +0200)]
x11: Move code where it belongs
Instead of the display telling the screen to tell the visuals to tell
the display to initialize itself, just init the display directly.
What a concept.
Benjamin Otte [Mon, 7 Jun 2021 12:56:25 +0000 (14:56 +0200)]
build: Build demos before tools
That's a sneaky trick so my edit/compile/test cycle goes faster:
I usually use demos for testing so the tools don't have to be linked for
me to start testing.
Matthias Clasen [Wed, 21 Jul 2021 21:33:53 +0000 (21:33 +0000)]
Merge branch 'destroy-pointer-gestures' into 'master'
gdk/wayland: Clean up gestures if pointer capability is withdrawn
See merge request GNOME/gtk!3697
Vlad Zahorodnii [Tue, 22 Jun 2021 06:23:42 +0000 (09:23 +0300)]
gdk/wayland: Clean up gestures if pointer capability is withdrawn
If the pointer capability is added, pointer swipe and pinch gestures
will be created. However, if the pointer capability is removed, the
gesture objects won't be destroyed.
If the pointer capability is removed and added several times in a row,
for example due to plugging and unplugging physical mouse, this can lead
to leaking the old gesture objects.
In order to prevent that, this change makes the seat destroy swipe and
pinch gestures when the pointer capability is withdrawn.
Matthias Clasen [Wed, 21 Jul 2021 17:49:15 +0000 (17:49 +0000)]
Merge branch 'sync-icons' into 'master'
Sync included icons from adwaita-icon-theme
See merge request GNOME/gtk!3773
Matthias Clasen [Tue, 20 Jul 2021 21:18:06 +0000 (17:18 -0400)]
Sync included icons from adwaita-icon-theme
Make sure we stay in sync with the Adwaita.
Matthias Clasen [Tue, 20 Jul 2021 18:25:59 +0000 (18:25 +0000)]
Merge branch 'wip/otte/build' into 'master'
Streamline build configuration
See merge request GNOME/gtk!3391
Benjamin Otte [Fri, 2 Apr 2021 01:05:40 +0000 (03:05 +0200)]
x11: Remove XComposite
It's only used during DND to allow use of the root window's cow window
as a DND target, because apparently gnome-shell used to think that was a
great idea to DND to the overview.
Somebody complain to gnome-shell devs about it not being a good idea if
they want it fixed.
Potentially using Wayland is a better idea though.
This reverts
85ae875dcbfcfa3fbdca857dc90467d39b9ff0c5
Related: https://bugzilla.gnome.org/show_bug.cgi?id=601731
Benjamin Otte [Fri, 2 Apr 2021 00:52:49 +0000 (02:52 +0200)]
x11: Remove unused headers
Benjamin Otte [Fri, 2 Apr 2021 00:13:49 +0000 (02:13 +0200)]
build: Make all X11 extensions mandatory
It's not 2011 anymore, and we shouldn't randomly build one of 10.000
different combinations of X11 backends (I counted the possibilities) but
exactly the one we expect people to use.
Benjamin Otte [Thu, 1 Apr 2021 19:29:41 +0000 (21:29 +0200)]
build: Remove sassc option
Instead, ensure that sassc is made madatory on git builds (because
it is, we don't ship CSS files anymore) and not even looked for in
release builds (because do ship CSS files there).
Benjamin Otte [Thu, 1 Apr 2021 16:08:19 +0000 (18:08 +0200)]
build: disable Vulkan by default
We don't want people to build Vulkan support when they just want to get
GTK built.
This is in particular true for GTK as a CI subproject or for people
using jhbuild.
Worse, just having Vulkan support compiled in tends to cause crashes
in the Inspector, even if you are not using it.
Benjamin Otte [Thu, 1 Apr 2021 15:59:18 +0000 (17:59 +0200)]
build: Set proper defaults for media backends
GTK supports webm playback, which means a backend should always be
compiled.
The ffmpeg backend however is incomplete (no audio) and as such, we
don't want people to end up with it accidentally.
Since we don't want to drag an entire gstreamer build into our ci
on MacOs or msvc, explicitly disable the gstreame media backend there.
Matthias Clasen [Tue, 20 Jul 2021 12:54:55 +0000 (12:54 +0000)]
Merge branch 'fix-dialog-docs' into 'master'
gtk/builder: Port example to GTK 4
See merge request GNOME/gtk!3772
Yuri Chornoivan [Tue, 20 Jul 2021 12:08:13 +0000 (12:08 +0000)]
Update Ukrainian translation
Maximiliano Sandoval R [Tue, 20 Jul 2021 11:15:57 +0000 (13:15 +0200)]
gtk/builder: Port example to GTK 4
Matthias Clasen [Tue, 20 Jul 2021 11:17:36 +0000 (11:17 +0000)]
Merge branch 'tooltip-hig' into 'master'
password_entry: Header Capitalization on tooltip
See merge request GNOME/gtk!3771
Maximiliano Sandoval R [Tue, 20 Jul 2021 11:00:05 +0000 (13:00 +0200)]
password_entry: Header Capitalization on tooltip
See https://teams.pages.gitlab.gnome.org/Design/hig-www/feedback/tooltips.html
Matthias Clasen [Tue, 20 Jul 2021 02:43:43 +0000 (02:43 +0000)]
Merge branch 'win32.hidpi.cleanup' into 'master'
GDK-Win32: Clean up HiDPI support and WGL slightly
Closes #3796
See merge request GNOME/gtk!3767
Matthias Clasen [Mon, 19 Jul 2021 18:36:11 +0000 (18:36 +0000)]
Merge branch 'ci-default-settings-4' into 'master'
reftests: Enforce default settings
See merge request GNOME/gtk!3769
Matthias Clasen [Mon, 19 Jul 2021 17:10:31 +0000 (13:10 -0400)]
reftests: Enforce default settings
Set all settings to their default values, so we
are less dependent on the environment to be set
up just right. In particular, this fixes animations
being disabled when we happen to run in a vm.
Chun-wei Fan [Mon, 19 Jul 2021 10:20:09 +0000 (18:20 +0800)]
GDK-Win32: Clean up HiDPI support and WGL a bit
Make _gdk_win32_display_get_monitor_scale_factor() less complex, by:
* Drop the preceding underscore.
* Dropping an unused parameter.
* Using a GdkSurface instead of a HWND, as the HWND that we pass into
this function might have been taken from a GdkSurface, which are now
always created with CS_OWNDC. This means if a GdkSurface was passed
in, we ensure that we only acquire the DC from the HWND once, and do
not attempt to call ReleaseDC() on it.
* Store the HDC that we acquire from the GdkSurface's HWND into the
surface, and use that as the HDC we need for our GdkGLContext.
* Drop the gl_hwnd from GdkWin32Display, as that is really should be
stored in the GdkSurface.
* For functions that were updated, name GdkWin32Display variables as
display_win32 and GdkSurface variables as surface, to unify things.
* Stop calling ReleaseDC() on the HDC that we use for OpenGL, since
they were acquired from HWND's created with CS_OWNDC.
Chun-wei Fan [Mon, 19 Jul 2021 02:44:48 +0000 (10:44 +0800)]
gdksurface-win32.c: Create all surfaces with CS_OWNDC
We want to ensure that we have things set up properly for drag surfaces
as well.
Matthias Clasen [Sat, 17 Jul 2021 13:05:42 +0000 (13:05 +0000)]
Merge branch 'pango-main' into 'master'
Use pango from the main branch
See merge request GNOME/gtk!3762
Yuri Chornoivan [Sat, 17 Jul 2021 05:34:21 +0000 (05:34 +0000)]
Update Ukrainian translation
Matthias Clasen [Fri, 16 Jul 2021 17:19:22 +0000 (13:19 -0400)]
Use pango from the main branch
Change the Pango subproject to use the main branch.
This depends on
https://gitlab.gnome.org/GNOME/pango/-/merge_requests/379
Benjamin Otte [Fri, 16 Jul 2021 16:26:23 +0000 (16:26 +0000)]
Merge branch 'wip/otte/for-master' into 'master'
cssimagecrossfade: Don't abort() when failing to parse image
Closes #4101
See merge request GNOME/gtk!3758
Benjamin Otte [Fri, 16 Jul 2021 15:48:25 +0000 (17:48 +0200)]
cssimagecrossfade: Don't abort() when failing to parse image
The code wasn't checking if parsing an image failed and just returning
success.
Testcase from bug is attached.
Fixes #4101
Matthias Clasen [Fri, 16 Jul 2021 11:59:47 +0000 (11:59 +0000)]
Merge branch 'fix-negative-scales' into 'master'
ngl: Handle negative scales
Closes #4096
See merge request GNOME/gtk!3755
Matthias Clasen [Fri, 16 Jul 2021 11:14:09 +0000 (11:14 +0000)]
Merge branch 'metainfo' into 'master'
metadata: Fix license identifiers and appdata
See merge request GNOME/gtk!3757
Matthias Clasen [Fri, 16 Jul 2021 11:11:20 +0000 (07:11 -0400)]
testsuite: Avoid negative scales with gl renderer
The fix in
1c90bb522e7e722b was only for the ngl renderer,
so don't use the test with the gl renderer, until it is
fixed as well.
Matthias Clasen [Fri, 16 Jul 2021 11:04:21 +0000 (11:04 +0000)]
Merge branch 'wip/chergert/fix-texthistory-insert' into 'master'
texthistory: fix calculation of n_chars
See merge request GNOME/gtk!3756
Maximiliano Sandoval R [Fri, 16 Jul 2021 08:46:53 +0000 (10:46 +0200)]
meson: Use a valid SPDX identifier
See https://mesonbuild.com/Reference-manual.html#license
Maximiliano Sandoval R [Fri, 16 Jul 2021 08:43:11 +0000 (10:43 +0200)]
appdata: Use launchable rather than id
<id> should be used for the component id and <launchable> for the
desktop file.
Maximiliano Sandoval R [Fri, 16 Jul 2021 08:41:40 +0000 (10:41 +0200)]
appdata: Add content_rating
https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-content_rating
Maximiliano Sandoval R [Fri, 16 Jul 2021 08:34:25 +0000 (10:34 +0200)]
appdata: Use correct SPDX license identifier
Following
https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-project_license,
for the complete list of identifiers see https://spdx.org/licenses/
Christian Hergert [Fri, 16 Jul 2021 02:19:57 +0000 (19:19 -0700)]
texthistory: fix calculation of n_chars
This should be the number of characters, not the end position. This fixes
an issue where we wouldn't coalesce insert actions together.
Benjamin Otte [Thu, 15 Jul 2021 21:33:54 +0000 (23:33 +0200)]
testsuite: Add test for crasher
Test for the crasher in !4096
Matthias Clasen [Thu, 15 Jul 2021 20:40:13 +0000 (16:40 -0400)]
ngl: Handle negative scales
Scale factors can be negative, but we were not
looking out for that, triggering an assertion when
trying to create a render target with negative
width of height. Avoid that.
Fixes: #4096
Matthias Clasen [Thu, 15 Jul 2021 18:39:48 +0000 (18:39 +0000)]
Merge branch 'transparent-optimizations' into 'master'
snapshot: Handle transparent opacity nodes correctly
See merge request GNOME/gtk!3754
Matthias Clasen [Thu, 15 Jul 2021 18:31:22 +0000 (18:31 +0000)]
Merge branch 'wip/baedert/for-master' into 'master'
snapshot: Replace trivial gradients with color nodes
See merge request GNOME/gtk!3753
Matthias Clasen [Thu, 15 Jul 2021 17:17:17 +0000 (13:17 -0400)]
ngl: Do nothing for transparent text nodes
Like the previous commit - a transparent text node
will not produce any visible pixels, so bail out early.
Matthias Clasen [Thu, 15 Jul 2021 17:16:37 +0000 (13:16 -0400)]
ngl: Do nothing for transparent color nodes
No need to send commands to the GPU to render transparency.
Matthias Clasen [Thu, 15 Jul 2021 17:14:13 +0000 (13:14 -0400)]
snapshot: Handle transparent opacity nodes correctly
Eliding totally transparent content from the node tree is
not 100% correct, since filters can make things visible, so
we need to at least preserve the bounds. We can do that by
creating a transparent color node.
Timm Bäder [Thu, 15 Jul 2021 14:52:38 +0000 (16:52 +0200)]
snapshot: Only compute start and end point if we have to
If the linear gradient results in a color node, we don't need the start
and end point. Only declare and compute it if we need to.
Timm Bäder [Thu, 15 Jul 2021 14:50:32 +0000 (16:50 +0200)]
snapshot: Replace trivial gradients with color nodes
Extend this to all existing gradient types
Benjamin Otte [Wed, 14 Jul 2021 18:46:36 +0000 (18:46 +0000)]
Merge branch 'wip/otte/for-master' into 'master'
rendernodeparser: Don't use %g when writing file
See merge request GNOME/gtk!3752
Benjamin Otte [Wed, 14 Jul 2021 18:19:40 +0000 (20:19 +0200)]
rendernodeparser: Remove leftover debug prints